package com.wrench.elevator.base.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSON;
import com.wrench.elevator.util.WrenchUtil;

@Controller
public class TestController
{
    @RequestMapping("/test")
    public void test(HttpServletResponse response)
    {
        
        List<UserTest> uts = new ArrayList<>();
        uts.add(new UserTest("ycf", "{\"name\":\"ycf\",\"age\":\"15\"}"));
        uts.add(new UserTest("hqx", "{\"name\":\"hqx\",\"age\":\"16\"}"));
        String str = JSON.toJSONString(uts);
        WrenchUtil.responseStr(response, str);
    }
}

class UserTest
{
    private String a;
    
    private String b;
    
    public String getA()
    {
        return a;
    }
    
    public void setA(String a)
    {
        this.a = a;
    }
    
    public String getB()
    {
        return b;
    }
    
    public void setB(String b)
    {
        this.b = b;
    }
    
    public UserTest(String a, String b)
    {
        super();
        this.a = a;
        this.b = b;
    }
    
    public UserTest()
    {
        super();
        // TODO Auto-generated constructor stub
    }
    
}
